/**
 * @author xuyh0817
 * @email xuyh0817@foxmail.com
 * @date 2022-02-16 01:41
 * @version 2.0.0
 * @doc todo
 * @website todo
 * @remark  如果要分发源码，需在本文件顶部保留此文件头信息！！
 */
import { COMPONENT_TYPE } from '../../constants'

export default [
  {
    id: '1',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'value',
      rules: [],
      label: '默认值',
      extra: 'value(v-model) 输入框内容',
    },
    attrs: {
      maxLength: 100,
      type: 'text',
      allowClear: true,
      placeholder: '请输入默认值'
    }
  },
  {
    id: '2',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'placeholder',
      rules: [],
      label: '提示内容',
      extra: 'placeholder 提示内容',
    },
    attrs: {
      maxLength: 100,
      value: '请输入',
      type: 'text',
      allowClear: true,
      placeholder: '请输入'
    }
  },
  {
    id: '3',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'addonBefore',
      rules: [],
      label: '前置标签',
      extra: '带标签的 input，设置前置标签 (string|slot)',
    },
    attrs: {
      maxLength: 30,
      type: 'text',
      allowClear: true,
      placeholder: '请输入前置标签'
    }
  },
  {
    id: '4',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'prefix',
      rules: [],
      label: '前缀图标',
      extra: '带有前缀图标的 input (string|slot)',
    },
    attrs: {
      maxLength: 2,
      type: 'text',
      allowClear: true,
      placeholder: '请输入前缀图标'
    }
  },
  {
    id: '5',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'suffix',
      rules: [],
      label: '后缀图标',
      extra: '带有后缀图标的 input (string|slot)',
    },
    attrs: {
      maxLength: 30,
      type: 'text',
      allowClear: true,
      placeholder: '请输入后缀图标'
    }
  },
  {
    id: '6',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'disabled',
      rules: [],
      label: '禁用状态',
      extra: '是否禁用状态，默认为 false',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '7',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'maxLength',
      rules: [],
      label: '最大长度',
      extra: '最大长度，默认为 100',
    },
    attrs: {
      value: 100
    }
  },
  {
    id: '8',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'size',
      rules: [],
      label: '控件大小',
      extra: '控件大小。注：标准表单内的输入框大小限制为 large。可选 large default small ',
    },
    attrs: {
      value: 'default',
      buttonStyle: 'solid',
      children: [
        {
          value: 'large',
          label: 'large'
        },
        {
          value: 'default',
          label: 'default'
        },
        {
          value: 'small',
          label: 'small'
        }
      ]
    }
  },
  {
    id: '9',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'allowClear',
      rules: [],
      label: '清除图标',
      extra: '可以点击清除图标删除内容，默认为 true',
    },
    attrs: {
      checked: true
    }
  },
  {
    id: '10',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'enterButton',
      rules: [],
      label: '确认按钮',
      extra: '是否有确认按钮，可设为按钮文字。该属性会与 addon 冲突。 (string|slot) ',
    },
    attrs: {
      checked: true
    }
  },
  {
    id: '11',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'loading',
      rules: [],
      label: '搜索loading',
      extra: '搜索 loading, 默认为 false',
    },
    attrs: {
      checked: false
    }
  }
]
